<!DOCTYPE html>
<html lang="en">
<head>

    <meta charset="UTF-8">
    <script type="text/javascript" src="assets/jwplayer.min.js"></script>
    <title>Captions in Playlist</title>
    <link type="text/css" rel="stylesheet" href="assets/style.css" />

</head>
<body>

<h2>Captions in Playlist</h2>

<ul id="loaders" style='display:none'>
    <li><a href="javascript:jwplayer().load({file:'http://content.bitsontherun.com/videos/7OCSON1y.mp4','captions.file':'assets/corrie.srt',title: 'Coronation Street'})">load() one video</a>
    <li><a href="javascript:jwplayer().load('assets/playlist.xml')">load() RSS feed</a>
</ul>

<div id="player"></div>
<script type="text/javascript">
function loadPlaylist(list) {
    var options = {
        controlbar: 'bottom',
        flashplayer: 'assets/player.swf',
        height: 300,
        'playlist.position': 'right',
        'playlist.size': 320,
        plugins: {
            '../captions.js': {}
        },
        stretching: 'fill',
        width: 800
    }
    if(typeof(list) == 'string') {
        options.file = list;
    } else { 
        options.playlist = list;
    }
    jwplayer("player").setup(options);
    document.getElementById('loaders').style.display = 'block';
};

var playlist = [{
    title: 'Coronation Street',
    description: 'Single, external SRT captions.',
    file: 'http://content.bitsontherun.com/videos/7OCSON1y.mp4', 
    image: 'http://content.bitsontherun.com/thumbs/7OCSON1y-320.jpg',
    'captions.file': 'assets/corrie.srt'
},{
    title:'Big Buck Bunny',
    description: 'Single, embedded MP4 captions.',
    file: 'http://content.bitsontherun.com/videos/aytCR4cx-393434.mp4',
    image: 'http://content.bitsontherun.com/thumbs/aytCR4cx-320.jpg'
},{
    title: 'Men With Talent',
    description: 'No captions at all.',
    file: 'http://content.bitsontherun.com/videos/SAs4hE5G.mp4',
    image: 'http://content.bitsontherun.com/thumbs/SAs4hE5G-320.jpg'
},{
    title: 'Global Timoto',
    description: 'Multiple, embedded MP4 captions.',
    file: 'http://content.bitsontherun.com/videos/w5VkaqJ1-393434.mp4',
    image: 'http://content.bitsontherun.com/thumbs/w5VkaqJ1-320.jpg'
},{
    title: 'Sintel',
    description: 'Multiple, external SRT captions.',
    file: 'http://content.bitsontherun.com/videos/3XnJSIm4-52qL9xLP.mp4',
    image: 'http://content.bitsontherun.com/thumbs/3XnJSIm4-320.jpg',
    'captions.files': 'assets/sintel-ch.srt,assets/sintel-fa.srt,assets/sintel-gr.srt,assets/sintel-jp.srt,assets/sintel-ko.srt,assets/sintel-pl.srt,assets/sintel-ru.srt,assets/sintel-sp.srt,assets/sintel-tr.srt',
    'captions.labels': 'Chinese,Farsi,Greek,Japanese,Korean,Polish,Russian,Spanish,Turkish'
}];
</script>

<ul>
    <li><a href="javascript:loadPlaylist('assets/playlist.xml')">RSS Playlist</a></li>
    <li><a href="javascript:loadPlaylist(playlist)">Inline playlist</a></li>
</ul>

<p>Test in Flash and in one HTML5/MP4 browser. For each entry, the correct captions should display.<br/>
    Also check the button to display the correct state (on, off, not set). Note the MP4 captions only work in Flash.
</p>
<p>
   The two additional links test the load() call of the API. They only work if the player is already visible.
</p>


</body>
</html>